package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.MallLogistics;
import com.sc.nft.mapper.MallLogisticsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * 物流信息表(MallLogistics)表Dao层
 *
 * @author wwc
 * @since 2023-05-17 13:17:42
 */
@Slf4j
@Repository
public class MallLogisticsDao extends ServiceImpl<MallLogisticsMapper, MallLogistics> {

    /**
     * 根据订单号和物流单号获取物流信息
     * @param orderId
     * @param logisticsId
     * @return
     */
    public MallLogistics getByOrderIdAndLogisticsId(String orderId, String logisticsId) {
        LambdaQueryWrapper<MallLogistics> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MallLogistics::getOrderId, orderId);
        wrapper.eq(MallLogistics::getLogisticsId, logisticsId);
        return this.getOne(wrapper);
    }

}
